package ch.fusun.baron.unit.ui;

import ch.fusun.baron.map.ui.gef.editpart.TileChild;
import ch.fusun.baron.swt.isometry.components.Sprite;
import ch.fusun.baron.unit.Unit;

/**
 * The unit tile child
 */
public class UnitTileChild implements TileChild<Unit> {

	private static final String ICONS_UNIT_MASK = "icons/unit_mask.png"; //$NON-NLS-1$
	private static final String ICON1_UNIT = "icons/unit.png"; //$NON-NLS-1$
	private final Unit unit;

	/**
	 * @param unit
	 *            the unit
	 */
	public UnitTileChild(Unit unit) {
		this.unit = unit;
	}

	@Override
	public Unit getModel() {
		return unit;
	}

	@Override
	public Sprite getSprite() {
		return new Sprite(Activator.getImage(ICON1_UNIT),
				Activator.getImage(ICONS_UNIT_MASK), 30);
	}
}
